<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        async function async1() {
            console.log('1');
            await async2();
            console.log('2');
        }

        async function async2() {
            console.log('3');
            
            // 代码1
            // return Promise.resolve({})

            // 代码2
            return {}
        }

        async1();

        new Promise(function (resolve) {
            console.log('4');
            resolve();
        }).then(function () {
            console.log('5');
            // return Promise.resolve() 试试这样？
        }).then(function () {
            console.log('6');
        }).then(function () {
            console.log('7');
        });

    </script>
</body>

</html>